package com.pai4j.zwiki.repository;

import com.pai4j.zwiki.domain.entity.ThesisFeedbackEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 论文反馈数据访问层
 *
 * @author pai4j
 * @since 2025-10-12
 */
@Repository
public interface ThesisFeedbackRepository extends JpaRepository<ThesisFeedbackEntity, Long> {

    /**
     * 通过任务ID查找所有反馈
     */
    List<ThesisFeedbackEntity> findByTaskIdOrderByCreatedAtDesc(String taskId);

    /**
     * 通过任务ID和版本号查找反馈
     */
    List<ThesisFeedbackEntity> findByTaskIdAndVersion(String taskId, Integer version);

    /**
     * 查找未处理的反馈
     */
    List<ThesisFeedbackEntity> findByProcessedFalseOrderByCreatedAtAsc();
}

